//
//  MainScene.m
//  lust
//
//  Created by fan on 13-4-2.
//
//

#import "MainScene.h"
#import "TankLayer.h"
#import "ControllLayer.h"
@implementation MainScene
+(CCScene*)scene
{
    MainScene* scene=[MainScene node];
    return scene;
}

-(id)init
{
    self=[super init];
    if(self)
    {
        CCTexture2D* texture=[[CCTextureCache sharedTextureCache] addImage:@"enemy.png"];
        
        CCSpriteFrame * frame0=[CCSpriteFrame frameWithTexture:texture rect:CGRectMake(40*0, 40*0, 40, 40)];
        CCSpriteFrame * frame1=[CCSpriteFrame frameWithTexture:texture rect:CGRectMake(40*1, 40*0, 40, 40)];
        
        [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFrame:frame0 name:@"e01"];
        [[CCSpriteFrameCache sharedSpriteFrameCache]addSpriteFrame:frame1 name:@"e02"];
        
        TankLayer* tl=[TankLayer node];
        ControllLayer* cl=[ControllLayer node];
        cl.gLayer=tl;
        [self addChild:tl];
        [self addChild:cl];
    }
    return self;
}
@end
